/**  
 * All rights Reserved
 * @Title:  HelloWebService.java   
 * @Package com.webservice   
 * @Description:    TODO   
 * @author: Joseph Gao     
 * @date:   2018年12月23日 下午9:55:50   
 * @version V1.0 
 * @Copyright: 2018 All rights reserved. 
 */
package com.webservice;

import javax.jws.WebService;
import javax.xml.ws.Endpoint;

/** 
* 
*
* @author Joseph
* @date 2018年12月23日
* 构建WebService服务之后，使用terminal生成client端code
* wsimport -s G:\\workspace\\webService\\TheClient\\src -p com.webservice.client -keep http://localhost:9001/Service/HelloWebService?wsdl
*/
@WebService
public class HelloWebService {

	/** 
	* <p>Title: </p> 
	* <p>Description: </p>  
	*/
	public HelloWebService() {
		// TODO Auto-generated constructor stub
	}
	
	/**
	 * @Title: name   
	 * @Description: TODO  
	 * @param: @return      
	 * @return: String      
	 * @throws
	 */
	public String getValue(String name) {
		return "hello, " + name;
	}

	/**@Title: main   
	 * @Description: TODO  
	 * @param: @param args      
	 * @return: void      
	 * @throws   
	 */
	public static void main(String[] args) {
		try {
			Endpoint.publish("http://localhost:9001/Service/HelloWebService", new HelloWebService());
			System.out.println("Host service success!");
			
			Thread.sleep(1000);
			
			new WebServiceTest().test();
			
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
	}

}
